@import './variables';
//reset
*{
    box-sizing: border-box;
    outline: none;
}
html{
    font-size: 13px;
}
body{
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.2rem;
    background-color: #f1f1f1;
    -webkit-font-smoothing:antialiased;
}
a{
    color: #999;
}

@each $colorkey,$color in $colors{
    .text-#{$colorkey}{
        color : $color;
    }
    .bg-#{$colorkey}{
        background-color: $color;
    }
}
//文本 text-align
@each $var in (left,center,right) {
    .text-#{$var}{
        text-align: $var !important;
    }
}


@each $sizeKey,$size in $font-sizes {
    .fs-#{$sizeKey}{
        font-size: $size * $base-font-size;
    }
}

//flex
.d-flex{
    display: flex;
}
.flex-column{
    flex-direction: column;
}
.flex-graw{
    flex-wrap: wrap;
}

@each $key,$value in $flex-js {
    .jc-#{$key}{
        justify-content: $value;
    }
}

@each $key,$value in $flex-ai {
    .ai-#{$key}{
        align-items: $value ;
    }
}
.flex-1{
    flex: 1;
}
.flex-grow-1{
    flex-grow: 1;
}

@each $typeKey,$type in $spacing-types {
    @each $sizeKey,$size in $spacing-sizes {
        // .mx-1
        .#{$typeKey}x-#{$sizeKey}{
            #{$type}-left : $size * $spacing-base-size;
            #{$type}-right : $size * $spacing-base-size;
        }
    }

    @each $sizeKey,$size in $spacing-sizes {
        //.my-1
        .#{$typeKey}y-#{$sizeKey}{
            #{$type}-top : $size * $spacing-base-size;
            #{$type}-bottom : $size * $spacing-base-size;
        }
        
        //.m-1
        .#{$typeKey}-#{$sizeKey}{
            #{$type} : $size * $spacing-base-size;
        }
    }

    @each $directionKey,$direction in $spacing-directions {
        @each $sizeKey,$size in $spacing-sizes {
            .#{$typeKey}#{$directionKey}-#{$sizeKey}{
                #{$type}-#{$direction} : $size * $spacing-base-size;
            }
        }
    }
}

//button
.btn{
    border: none;
    border-radius: 0.1538rem;
    font-size: map-get($font-sizes, 'sm') * $base-font-size;
    padding: 0.2rem 0.6rem;
}
//nav
.nav{
    display: flex;
    .nav-item{
        border-bottom: 3px solid transparent;
        padding-bottom: 0.2rem;
        &.active{
            color: map-get($colors,'primary');
            border-bottom-color: map-get($colors, 'primary');
        }
    }
    &.nav-inverse{
        .nav-item{
            color: map-get($colors,'white');
            &.active{
                border-bottom-color: map-get($colors,'white');
            }
        }
    }
}

//width height
.w-100{
    width: 100%;
}
.h-100{
    height: 100%;
}
.sprite{
    background: url(../images/index.png) no-repeat 0 0;
    background-size: 375px 455px;
    display: inline-block;
    &.sprite-1{
        width: 23px;
        height: 20px;
        background-position: 63.546% 15.517%;
    }
    &.sprite-2{
        width: 23px;
        height: 20px;
        background-position: 90.483% 15.614%;
    }
    &.sprite-3{
        width: 19px;
        height: 22px;
        background-position: 36.746% 0.924%;
    }
    &.sprite-4{
        width: 20px;
        height: 20px;
        background-position: 10.408% 15.517%;
    }
    &.sprite-5{
        width: 20px;
        height: 21px;
        background-position: 89.733% 1.266%;
    }
    &.sprite-6{
        width: 24px;
        height: 20px;
        background-position: 36.467% 15.287%;
    }
    &.sprite-7{
        width: 26px;
        height: 21px;
        background-position: 9.728% 1.266%;
    }
    &.sprite-8{
        width: 24px;
        height: 24px;
        background-position: 63.3% 0.927%;
    }
    &.sprite-9{
        width: 24px;
        height: 20px;
        background-position:  0 96.207%;
    }
    &.sprite-10{
        width: 20px;
        height: 25px;
        background-position: 10.408% 27.209%;
    }&.sprite-arrow{
        width: 10px;
        height: 10px;
        background-position: 38.577% 52.076%;
    }
}